<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active {
            color: red
        }

        .ma {
            color: aqua;
            background-color: blueviolet;
        }
    </style>
</head>

<body>
    <script src="../框架相关的js/vue.js"></script>
    <div id="app">
        <div class="ma" :class="{ 'active': isActive}">1111111</div>
        <!-- classObject 本来也是一个对象  {  active: true, 'text-danger': true }--> 
        <div v-bind:class="classObject">哈哈哈😢</div>
        <div v-show="ma">5433222</div>
    </div>


    <!-- 你可以在对象中传入更多字段来动态切换多个 class。此外，v-bind:class 指令也可以与普通的 class attribute 共存。当有如下模板： -->
    <!-- <div
      class="static"
      v-bind:class="{ active: isActive, 'text-danger': hasError }"
    ></div> -->

    <script>
        new Vue({
            el: '#app',
            data: {
                isActive: true,
                classObject: {
                    active: true,
                    'text-danger': true
                },
                ma:false
            }

        })
    </script>
</body>

</html>